#include "texture.h"
#include "render_device.h"

c_texture9::c_texture9(const d3d9_texture_ptr& d3d9_texture)
    : m_d3d9_texture(d3d9_texture)
{
}

c_texture9::~c_texture9()
{
}

texture_ptr create_texture_from_file(const std::string& name)
{
    d3d9_texture_ptr d3d9_texture;
    d3d9_device_ptr device = c_render_device9::get_singleton().get_d3d_device_ptr();

    HRESULT hr; 
    V(D3DXCreateTextureFromFileA(device, name.c_str(), &d3d9_texture));
    texture_ptr tex(new c_texture9(d3d9_texture));

    return tex; 
}